package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_message;

//DAO
public interface T_messageMapperBase {

	//根据id查看
    @Select("SELECT * FROM t_message  WHERE id = #{id}")
	public ApiT_message findT_messageById(Integer id);
	
    //查看数据集
    @Select("SELECT * FROM T_message")
	public List<ApiT_message> findT_messages();
	
	//添加
    @Insert("INSERT INTO t_message (orderid, shop_id, u_id, messagetype, is_send, status, inserttime, operatetime, title, content, ext_1, ext_2, ext_3, ext_4, ext_5) VALUES (#{orderid}, #{shop_id}, #{u_id}, #{messagetype}, #{is_send}, #{status}, #{inserttime}, #{operatetime}, #{title}, #{content}, #{ext_1}, #{ext_2}, #{ext_3}, #{ext_4}, #{ext_5})")
 	@Options(useGeneratedKeys = true, keyProperty = "id")
    public int insertT_message(ApiT_message t_message);
  	
	//修改
    @Update("UPDATE t_message SET orderid = #{orderid}, shop_id = #{shop_id}, u_id = #{u_id}, messagetype = #{messagetype}, is_send = #{is_send}, status = #{status}, inserttime = #{inserttime}, operatetime = #{operatetime}, title = #{title}, content = #{content}, ext_1 = #{ext_1}, ext_2 = #{ext_2}, ext_3 = #{ext_3}, ext_4 = #{ext_4}, ext_5 = #{ext_5} WHERE id = #{id}")
    public int updateT_message(ApiT_message t_message);
    
    //删除
    @Delete("DELETE FROM t_message  WHERE id = #{id}")
    public int deleteT_message(Integer id);
 
    // Foreign keys revelant		
		

	//region Indexs revelant
    
    
    
}


